/*
 * tangoc.h
 *
 *  Created on: 2011-12-14
 *      Author: pixcir
 */

#ifndef TANGOC_H
#define TANGOC_H

#define  DEFAULT				0
#define  CALIBRATION_FLAG		1
#define  NORMAL_MODE			8
#define  DEBUG_ORIGIN_MODE		3
#define  DEBUG_EEPROM_OFFSET	4
#define  RASTER_ORIGIN_MODE		5
#define  VERSION_FLAG			6
#define  BOOTLOADER_MODE    	7
#define  BUTTON_RAW         	2
#define  REEPROM            	12
#define  WEEPROM            	13
#define	 RESET_TP				9
#define  ENABLE_IRQ         	10
#define  DISABLE_IRQ        	11
#define	 BOOTLOADER_STU			16
#define  ATTB_VALUE				17
#define  READ_CRC 				18
#define  RASTER_EEPROM_OFFSET	19
#define  OFFSET_MODE        	20
#define  DEBUG_RAM_OFFSET   	21

#define  RASTER_LX_SY			22
#define  RASTER_LX_SY_OFFSET	23
#define  RASTER_LY_SX			24
#define  RASTER_LY_SX_OFFSET	25
#define  TUNE_DEBUG             26

// list user mode version
#define  MP71   (0x12C7)
#define  MP72   (0x0DA2)
#define  MP80	(0xAED7)
#define  MP81	(0xBAE6)
#define  MP82	(0xDF7A)
#define  MP83	(0x15EC)
#define  MP84	(0xC0EC)
#define  MP90  	(0xEAC8)
#define  MP91   (0x53BF)
#define  MP92	(0xF0CD)

// list tune mode versoin
#define  TM70	(0x66B8)
#define  TM80	(0x6356)
#define  TM81	(0xF31C)
#define  TM82	(0x4933)

extern int gdev;

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>


union short_char
{
	unsigned short int num;
	unsigned char buf[2];
};

union int_char
{
	unsigned int num;
	unsigned char buf[4];
};

extern void finish();
extern void get_time(int mode, char *buf);


#endif /* TANGOC_H_ */
